import styles from './index.less';
import Qr from 'qrcode.react';

interface Iqrcode {
  url: string
  size?: number;
  includeMargin?: boolean;
  bgColor?: string;
  fgColor?: string;
  level?: "L" | "M" | "Q" | "H";
  desc?: string
}

export default function Page({ url, size, includeMargin,bgColor,fgColor,level, desc }: Iqrcode) {
  return (
    <div className={styles.container} hidden={!url}>
      <h2 className={styles.title}>{desc}</h2>
      <Qr value={url} size={size} level={level} includeMargin={includeMargin} bgColor={bgColor} fgColor={fgColor} renderAs="svg"></Qr>
    </div>
  );
}
